include std/dll.e
include std/machine.e

include core.e
include wrap_helpers.e

constant
	hQtTreeWidgetSetHeaderText = define_c_proc(hEuQt, "qt_treewidget_set_header_text", {P,I,P}),
	hQtTreeWidgetAdd = define_c_proc(hEuQt, "qt_treewidget_add", {P, P})

public procedure set_header_title(atom parent, integer column, sequence name)
	atom pName = allocate_string(name,1)
	c_proc(hQtTreeWidgetSetHeaderText, { parent, column, pName })
	--~ free(pName)
end procedure

public procedure set_header_titles(atom parent, sequence names)
	for i = 1 to length(names) do
		set_header_title(parent, i-1, names[i])
	end for
end procedure

public procedure add(atom widget, sequence values)
	atom pValues = allocate_string_pointer_array(values,1)
	c_proc(hQtTreeWidgetAdd, {widget, pValues})
	--~ free_pointer_array(pValues)
end procedure
